Friday, June 19, 2015

interface in c#

An Interface look like a class but no implementation. the only thing it contains is declaration of event, indexes, methods and/or property. the reason interface only provide declarations is because they are inherited by struts and classes that must provide an implemention for each interface member declared.

public partial interface IVendorService
   {
       /// <summary>
       /// Gets a vendor by vendor identifier

       Vendor GetVendorById(int vendorId);
 
       /// <summary>
       /// Delete a vendor

       void DeleteVendor(Vendor vendor);
 
       /// <summary>
       /// Gets all vendors
     
       IPagedList<Vendor> GetAllVendors(string name = "", 
           int pageIndex = 0, int pageSize = int.MaxValue, bool showHidden = false);
 
       void InsertVendor(Vendor vendor);
 
 
       void UpdateVendor(Vendor vendor);
 
 
       VendorNote GetVendorNoteById(int vendorNoteId);
 
       /// <summary>
       /// Deletes a vendor note

       void DeleteVendorNote(VendorNote vendorNote); 
   } 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.