public ClientBasicInfoDTO GetClientBasicInfo(int id) { ClientBasicInfoDTO clientBasicInfo = null; using (var context = new EnsuranceDBEntities()) { clientBasicInfo = context.Clients.AsNoTracking() .Where(c => c.Id == id) .Select(c => new ClientBasicInfoDTO { Id = c.Id, FirstName = c.FirstName, LastName = c.LastName }).FirstOrDefault <ClientBasicInfoDTO>(); } return(clientBasicInfo); }
public IHttpActionResult GetBasicInfo(int id) { ClientBasicInfoDTO clientBasicInfo = repository.GetClientBasicInfo(id); return(Ok(clientBasicInfo)); }