예제 #1
0
 public IDataLoadResult SetDataLoadResult(IDataLoadResult value)
 {
     using (var context = new RioValleyChiliDataContext())
     {
         var result = context.DataLoadResult.ToList().OrderBy(r => r.Id).LastOrDefault() ?? context.DataLoadResult.Add(new Models.DataLoadResult());
         result.Success         = value.Success;
         result.RanToCompletion = value.RanToCompletion;
         result.TimeStamp       = value.TimeStamp;
         context.SaveChanges();
     }
     return(value);
 }
예제 #2
0
 public IDataLoadResult GetDataLoadResult()
 {
     try
     {
         using (var context = new RioValleyChiliDataContext())
         {
             return(context.DataLoadResult.ToList().OrderBy(r => r.Id).LastOrDefault());
         }
     }
     catch (Exception)
     {
         return(new LoadResult
         {
             Success = false,
         });
     }
 }