Show / Hide Table of Contents

    IDataStoreBase.DeletedCount Property

    .NET Standard 2.x

    Gets the total number of rows that are marked for deletion in the database.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public int DeletedCount { get; }
    

    System.Int32

    The total number of rows that are marked for deletion in the database.

    Examples

    The following code example deletes the data in the DataStore and then uses the DataStore DeletedCount property to get the total number of the deleted rows.

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreBaseExamples
    {
        public class DeletedCountExample
        {
            private readonly SchoolContext _context;
    
            public DeletedCountExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example()
            {
                // Instantiates datastore with datawindow: d_department.
                var datastore = new DataStore("d_department", _context);
                
                datastore.Retrieve();
    
                Console.WriteLine("Retrieved Rowcount: {0}",
                                   datastore.RowCount);
    
                // Deletes the first row in datastore.
                datastore.DeleteRow(0);
    
                Console.WriteLine("After deleted, Deletedcount: {0}",
                                   datastore.DeletedCount);
    
                Console.WriteLine("After deleted, Rowcount: {0}",
                                   datastore.RowCount);
    
                /*This code produces the following output:
                
                Retrieved Rowcount: 4
                After deleted, Deletedcount: 1
                After deleted, Rowcount: 3
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon