public ContextFactory( string typeName, string schema) { var columns = schema .Split(',') .Select(x => x.Split(':')) .Select((x, i) => new Column { Name = x[0], TypeName = x[1], Offset = i, }) .ToArray(); this.context = this.Construct(typeName, columns); }
private ContextTemplate Construct(string typeName, Column[] columns) { var cxt = new ContextTemplate { Key = "ID", Columns = columns, }; var service = PluralizationService.CreateService(CultureInfo.CurrentCulture); if (service.IsPlural(typeName)) { cxt.RowName = service.Singularize(typeName); cxt.TableName = typeName; } else { cxt.RowName = typeName; cxt.TableName = service.Pluralize(typeName); } return(cxt); }
public ContextFactory( string typeName, Column[] columns) { this.context = this.Construct(typeName, columns); }