开发者

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?

  1. 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.
  2. Use the Reflection data provider
  3. Write your data provider
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜