public async Task <JsonResult> GetByID(string id, string api)
 {
     try {
         var data = LocationSessionService.GetByID(Guid.Parse(id), Guid.Parse(api));
         return(Success(LocationSessionVM.MToVM(data)));
     } catch { return(Failed(MessageUtility.ServerError())); }
 }
Exemple #2
0
 public static bool Insert(Guid id, string name, Guid api)
 {
     try {
         using (var context = new GeopersonContext()) {
             var model = LocationSessionVM.Set(id, name, api);
             context.LocationSessionDB.Add(model);
             context.SaveChanges();
             return(true);
         }
     } catch { return(false); }
 }