public async Task<HttpResponseMessage> SendUserRequest(UserRequest request) { request.DateTime = DateTime.Now; string id = await service.SaveUserRequestAsync(request); return Request.CreateResponse(HttpStatusCode.OK, id); }
public string SaveUserRequest(UserRequest model) { context.UserRequests.Add(model); context.SaveChanges(); context.Entry<UserRequest>(model).GetDatabaseValues(); return model.Id.ToString(); }