private List <string> GetLookupValuesByLookupName(string name) { List <string> values = new List <string>(); OriginDataContext context = new OriginDataContext(); OR_Lookup lookup = context.OR_Lookups .Where(l => l.Name.Equals(name)) .FirstOrDefault(); values = context.OR_LookupValues .Where(v => v.RelatedOriginId.Equals(lookup.OriginId)) .Select(v => v.Value).ToList(); return(values); }
public GetLookupResponse GetLookup(string name) { GetLookupResponse viewModel = new GetLookupResponse(); OriginDataContext context = new OriginDataContext(); OR_Lookup lookup = context.OR_Lookups .Where(l => l.Name.Equals(name)) .FirstOrDefault(); viewModel.Name = name; viewModel.Values = context.OR_LookupValues .Where(v => v.RelatedOriginId.Equals(lookup.OriginId)) .Select(v => v.Value); return(viewModel); }
partial void UpdateOR_Lookup(OR_Lookup instance);
partial void DeleteOR_Lookup(OR_Lookup instance);
partial void InsertOR_Lookup(OR_Lookup instance);