mardi 26 mai 2015

Seperating interfaces and making them more generic

I have an interface to define my records\models

public interface IStockItem
{
    string Code { get; set; }
    string Description { get; set; }
    decimal FreeStock { get; set; }
}

Is it best to put the actions into another interface?

public interface IStockExport
{
    IEnumerable<IStockItem> GetAll();
    IEnumerable<IStockItem> GetStockByCode(string code);
    decimal GetFreeStock(string code);
}

public interface IStockImport
{
    void CreateItem<IStockItem>;
}

Is there a better way to do this and make it more generic? so i can share the actions interfaces with other records\models?

Aucun commentaire:

Enregistrer un commentaire