protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         db.Dispose();
     }
     base.Dispose(disposing);
 }
示例#2
0
    public static MyModel Create()
    {
        var model = new MyModel();

        try
        {
            model.Database.ExecuteSqlCommand(
                "SET SESSION sql_mode = 'PAD_CHAR_TO_FULL_LENGTH';");
        }
        catch
        {
            model.Dispose();
            throw;
        }
        return(model);
    }
示例#3
0
 public void Dispose()
 {
     model.Dispose();
 }
示例#4
0
 protected override void Dispose(bool disposing)
 {
     _mm.Dispose();
     base.Dispose(disposing);
 }