/// <summary> /// Look up a type in the EntityFramework based on the type identifier. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="edmx"></param> /// <param name="identifier"></param> /// <returns></returns> public static T ResourceWithIdentifier <T>(this EntityFramework edmx, string identifier) where T : class { return(edmx.DataServices.Schemas.ResourceWithIdentifier <T>(identifier)); }
public IODataNavigable NavigateByEntityTypeKey(EntityFramework edmx, IssueLogger issues) { throw new NotSupportedException(); }
public IODataNavigable NavigateByEntityTypeKey(EntityFramework edmx, IssueLogger issues) { return(edmx.ResourceWithIdentifier <IODataNavigable>(this.TypeIdentifier)); }
public IODataNavigable NavigateByUriComponent(string component, EntityFramework edmx, IssueLogger issues, bool isLastSegment) { throw new NotSupportedException($"simple type can't navigate to {component}"); }
public static IODataNavigable NavigateByFunction(this IODataNavigable source, string component, EntityFramework edmx, bool isLastSegment) { var matches = edmx.DataServices.Schemas.SelectMany(s => s.Functions). Where(f => f.IsBound && (f.Name == component || f.ParameterizedName == component) && f.ReturnType?.Type != null && f.Parameters.Any(p => p.Name == "bindingParameter" && p.Type.TypeOnly() == source.TypeIdentifier.TypeOnly())). ToList(); if (matches.Any()) { foreach (var m in matches) { m.IsComposable = true; } var match = matches.First().ReturnType.Type; return(edmx.ResourceWithIdentifier <IODataNavigable>(match)); } var otherCaseName = edmx.DataServices.Schemas.SelectMany(s => s.Functions). Where(f => f.IsBound && (f.Name.IEquals(component) || f.ParameterizedName.IEquals(component)) && f.Parameters.Any(p => p.Name == "bindingParameter" && p.Type.TypeOnly() == source.TypeIdentifier.TypeOnly())). Select(f => f.Name.IEquals(component) ? f.Name : f.ParameterizedName). FirstOrDefault(); if (otherCaseName != null) { throw new ArgumentException($"ERROR: case mismatch between URL segment '{component}' and schema element '{otherCaseName}'"); } return(null); }
public override void ApplyTransformation(BaseModifications value, EntityFramework edmx, string[] versions) { base.ApplyTransformation(value, edmx, versions); }
public override IODataNavigable NavigateByEntityTypeKey(EntityFramework edmx, IssueLogger issues) { throw new NotImplementedException(); }
public void ApplyTransformation(BaseModifications mods, EntityFramework edmx, string[] versions) { TransformationHelper.ApplyTransformation(this, mods, edmx, versions); }