Skip to content

v3.10.0

Latest
Compare
Choose a tag to compare
@sjh37 sjh37 released this 29 Jan 15:57
  • Added EF Core 9 support
  • #849 Added support for ARM64 processor. Thanks to Rob.
  • Removed EF Core 7 (See support planning wiki)
  • Added support property for resultsets. Thanks to Frederic.
  • #821 Enable command timeout override. Thanks to Frederic.
    With this adjustment, it is possible to override the default commandtimeout at runtime which can be necessary for specific stored procedures.
_context.Database.CommandTimeout = 300;
return _context.spMyHeavyStoredProcedure.FirstOrDefault();
  • #820 Support resultset as property instead of a field in a stored procedure return model.
  • #621 Generate async methods (PR #797). Thanks to Erwin Bovendeur.
  • #819 Added "IsSynonym" property to Table class. Thanks to grantparker77.
  • #826 Allow table with periods. Periods in table names are replaced with an underscore.
  • #37 Merge duplicate stored procedure result sets. A new setting flag which defaults to true. This will cause the generator to inspect multiple result sets to see if they are all identical. If they are all identical, the duplicates will be removed, leaving a single model.
Settings.MergeMultipleStoredProcModelsIfAllSame = true;
  • #832 Add more data annotations.
[Table("table-name", Schema = "schema-name")]
  • #838 You can now generate multiple enums from a single table that contains a grouping field. Thanks to Ryan Plemons.
  • Inflector to correctly handle words and tables ending with: Status, To and Data.
  • Added more examples of adding base classes.
  • #834 SQLite - Support multiple foreign keys. Thanks to statler.
  • #298 Forward the cancellationToken parameter to the ToListAsync methods (PR #842). Thanks to mhartmair-cubido.
  • Enable more granular prepend schema support on a table and stored procedure level (PR #824). Thanks to dsfr-be and Frederic.
/// <summary>
/// Enables more granual control if the schema name should be prepend depending on the table
/// </summary>
public static Func<Table, bool> PrependSchemaNameForTable = (table) => {
    return true;
};

/// <summary>
/// Enables more granual control if the schema name should be prepend depending on the proc
/// </summary>
public static Func<StoredProcedure, bool> PrependSchemaNameForStoredProcedure = (prod) => {
    return true;
};
  • #822 Intercept stored procedure return model creation. Thanks to Frederic Desmyter.
// Enable interception of stored procedure return model when an exception occurs. Typically, when the stored procedure contains temp tables.
// This allows you render the proper error in comments or fix the return model by manually creating the ReturnModel using a list of DataColumns
public static Action<Exception, StoredProcedure> ReadStoredProcReturnObjectException = delegate (Exception ex, StoredProcedure sp)
{
    // Example
    /*if (!sp.ReturnModels.Any() && ex.Message.StartsWith("Invalid object name", StringComparison.OrdinalIgnoreCase))
    {
        if (sp.NameHumanCase.Equals("YourProcNameHere", StringComparison.OrdinalIgnoreCase))
        {
            sp.ReturnModels.Add(new List<DataColumn>
            {
                new DataColumn("Id", typeof(int)) { AllowDBNull = false, Unique = true },
                new DataColumn("Description", typeof(string))
            });
        }
    }*/
};

// Enable interception of stored procedure return model
public static Action<StoredProcedure> ReadStoredProcReturnObjectCompleted = delegate (StoredProcedure sp)
{
    // Example of how to add a row processed boolean column to a stored procedure's return model
    /*if (sp.ReturnModels.Any() && sp.NameHumanCase.Contains("process"))
    {
        var rm = sp.ReturnModels.First();
        rm.Add(new DataColumn("RowProcessed", typeof(bool)) { AllowDBNull = false });
    }*/
};