public List <RolDTO> Read() { using (Persistence.InfoSellersEntities data = new Persistence.InfoSellersEntities()) { return(data.Rol.Select(t => new RolDTO() { ID = t.ID, RolName = t.RolName, CommissionTypeID = t.ID }).ToList()); } }
public List <CommissionTypeDTO> Read() { using (Persistence.InfoSellersEntities data = new Persistence.InfoSellersEntities()) { return(data.CommissionType.Select(t => new CommissionTypeDTO() { ID = t.ID, CommissionTypeName = t.CommissionTypeName, CommissionValue = t.CommissionValue }).ToList()); } }
public RolDTO ReadById(int id) { using (Persistence.InfoSellersEntities data = new Persistence.InfoSellersEntities()) { var entity = data.Rol.Find(id); if (entity != null) { return(new RolDTO() { ID = entity.ID, RolName = entity.RolName, CommissionTypeID = entity.ID }); } else { return(null); } } }
public CommissionTypeDTO ReadById(int id) { using (Persistence.InfoSellersEntities data = new Persistence.InfoSellersEntities()) { var entity = data.CommissionType.Find(id); if (entity != null) { return(new CommissionTypeDTO() { ID = entity.ID, CommissionTypeName = entity.CommissionTypeName, CommissionValue = entity.CommissionValue }); } else { return(null); } } }