public IHttpActionResult Get(int id) { DTO_CUS_DOC_File_Actitity tbl_CUS_DOC_File_Actitity = BS_CUS_DOC_File_Actitity.get_CUS_DOC_File_Actitity(db, PartnerID, id); if (tbl_CUS_DOC_File_Actitity == null) { return(NotFound()); } return(Ok(tbl_CUS_DOC_File_Actitity)); }
public IQueryable <DTO_CUS_DOC_File_Actitity> Get() { var result = BS_CUS_DOC_File_Actitity.get_CUS_DOC_File_Actitity(db, PartnerID, QueryStrings).ToList(); if (result != null) { var context = new Models.ApplicationDbContext(); var users = context.Users.ToList(); foreach (var item in result) { var u = users.FirstOrDefault(d => d.Email == item.CreatedBy); if (u != null) { item.ModifiedByName = u.FullName; item.Avatar = u.Avatar; } } } return(result.AsQueryable()); }