public RelationSchemaLoaderResult GetResult() { var PrimitiveNames = new HashSet <String>(TypeRefs.Concat(Types).Where(t => t.OnPrimitive).Select(t => t.Primitive.Name).Distinct()); if (PrimitiveNames.Contains("Byte") && !PrimitiveNames.Contains("Binary")) { Types.Add(TypeDef.CreatePrimitive(new PrimitiveDef { Name = "Binary", Attributes = new List <KeyValuePair <String, List <String> > > { }, Description = "" })); } var rslr = new RelationSchemaLoaderResult { Schema = new Schema { Types = Types, TypeRefs = TypeRefs, Imports = Imports }, Positions = Positions }; RelationSchemaExtensions.VerifyDuplicatedNames(rslr); var Entities = Types.Where(t => t.OnEntity).ToDictionary(t => t.Entity.Name, t => t.Entity); foreach (var e in Types.Where(t => t.OnEntity).Select(t => t.Entity)) { FillEntity(e, Entities); } foreach (var e in Types.Where(t => t.OnEntity).Select(t => t.Entity)) { FillEntityNavigations(e, Entities); } return(rslr); }
public String GetLimitedName(int MaxLength) { return(RelationSchemaExtensions.GetLimitedKeyName("FK", GetIdentifier(), MaxLength)); }