OData service to expose entity populated from multiple data sources
This entity will be exposed via a Read-Only OData service, CompanySummary.svc
public class CompanySummary
{
//populated from an Odata service#1 that exposed data from db#1
public int PrimaryId { 开发者_如何学JAVAget; set; } // this will be the DataServiceKey
public int? SecondaryId { get; set; }
public string SomeStringAttribute_1 { get; set; }
//populated from an Odata service#2 that exposed data from db#2
public bool? SomeBoolProperty { get; set; }
//populated from an Odata service#3 that exposed data from db#3
public string SomeStringAttribute_2 { get; set; }
}
So what is the suggested way to populate this mash-up entity and expose it via a read-only OData service?
- Use the EF data provider - create a view in the db#1 that mimics this entity. Populate the fields that are available from db#1, and the rest of the fields can have some dummy values. Create an entity in the edmx that uses this DB view. Then in the QueryInterceptor for the entity use the other OData services to populate the fields.
- Use the Reflection data provider
- Write your data provider
精彩评论