Exemple #1
0
        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);
        }
Exemple #2
0
        public IHttpActionResult GetBasicInfo(int id)
        {
            ClientBasicInfoDTO clientBasicInfo = repository.GetClientBasicInfo(id);

            return(Ok(clientBasicInfo));
        }