Exemplo n.º 1
0
 public async Task SaveFigureAsync(Guid id, double area)
 {
     using (var db = new FigureContext())
     {
         db.Add(new db.Figure()
         {
             Id   = id,
             Area = area
         });
         await db.SaveChangesAsync();
     }
 }
Exemplo n.º 2
0
 public void Save(bl.Figure figure)
 {
     using (var db = new FigureContext())
     {
         db.Add(new db.Figure()
         {
             Id   = figure.Id,
             Data = JsonConvert.SerializeObject(figure, new JsonSerializerSettings {
                 TypeNameHandling = TypeNameHandling.All
             })
         });
         db.SaveChanges();
     }
 }