本文整理汇总了C#中MergeOption类的典型用法代码示例。如果您正苦于以下问题:C# MergeOption类的具体用法?C# MergeOption怎么用?C# MergeOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MergeOption类属于命名空间,在下文中一共展示了MergeOption类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AtomMaterializerLog
internal AtomMaterializerLog(ResponseInfo responseInfo)
{
this.responseInfo = responseInfo;
this.mergeOption = responseInfo.MergeOption;
this.identityStack = new Dictionary<string, ODataEntry>(EqualityComparer<string>.Default);
this.links = new List<LinkDescriptor>();
}
示例2: Calls_collection_override_passing_in_null
private void Calls_collection_override_passing_in_null(MergeOption mergeOption)
{
var entityCollectionMock = MockHelper.CreateMockEntityCollection<object>(null);
int timesLoadCalled = 0;
entityCollectionMock.Setup(m => m.Load(It.IsAny<List<IEntityWrapper>>(), It.IsAny<MergeOption>()))
.Callback((IEnumerable<object> actualCollection, MergeOption actualMergeOption) =>
{
timesLoadCalled++;
Assert.Equal(null, actualCollection);
Assert.Equal(mergeOption, actualMergeOption);
});
int timesCheckOwnerNullCalled = 0;
entityCollectionMock.Setup(m => m.CheckOwnerNull())
.Callback(() =>
{
timesCheckOwnerNullCalled++;
});
entityCollectionMock.Object.Load(mergeOption);
entityCollectionMock.Verify(m => m.Load(It.IsAny<List<IEntityWrapper>>(), It.IsAny<MergeOption>()));
Assert.True(1 == timesLoadCalled, "Expected Load to be called once for MergeOption." + mergeOption);
Assert.True(1 == timesCheckOwnerNullCalled, "Expected CheckOwnerNull to be called once for MergeOption." + mergeOption);
}
示例3: TryRewrite
internal static bool TryRewrite(DbQueryCommandTree tree, Span span, MergeOption mergeOption, AliasGenerator aliasGenerator, out DbExpression newQuery, out SpanIndex spanInfo)
{
newQuery = null;
spanInfo = null;
ObjectSpanRewriter rewriter = null;
bool requiresRelationshipSpan = Span.RequiresRelationshipSpan(mergeOption);
// Potentially perform a rewrite for span.
// Note that the public 'Span' property is NOT used to retrieve the Span instance
// since this forces creation of a Span object that may not be required.
if (span != null && span.SpanList.Count > 0)
{
rewriter = new ObjectFullSpanRewriter(tree, tree.Query, span, aliasGenerator);
}
else if (requiresRelationshipSpan)
{
rewriter = new ObjectSpanRewriter(tree, tree.Query, aliasGenerator);
}
if (rewriter != null)
{
rewriter.RelationshipSpan = requiresRelationshipSpan;
newQuery = rewriter.RewriteQuery();
if (newQuery != null)
{
Debug.Assert(rewriter.SpanIndex != null || tree.Query.ResultType.EdmEquals(newQuery.ResultType), "Query was rewritten for Span but no SpanIndex was created?");
spanInfo = rewriter.SpanIndex;
}
}
return (spanInfo != null);
}
示例4: CreateXrmServiceContext
protected XrmServiceContext CreateXrmServiceContext(MergeOption? mergeOption = null)
{
//string organizationUri = ConfigurationManager.AppSettings["CRM_OrganisationUri"];
string organizationUri = "https://existornest2.api.crm4.dynamics.com/XRMServices/2011/Organization.svc";
IServiceManagement<IOrganizationService> OrganizationServiceManagement = ServiceConfigurationFactory.CreateManagement<IOrganizationService>(new Uri(organizationUri));
AuthenticationProviderType OrgAuthType = OrganizationServiceManagement.AuthenticationType;
AuthenticationCredentials authCredentials = GetCredentials(OrgAuthType);
AuthenticationCredentials tokenCredentials = OrganizationServiceManagement.Authenticate(authCredentials);
OrganizationServiceProxy organizationProxy = null;
SecurityTokenResponse responseToken = tokenCredentials.SecurityTokenResponse;
if (ConfigurationManager.AppSettings["CRM_AuthenticationType"] == "ActiveDirectory")
{
using (organizationProxy = new OrganizationServiceProxy(OrganizationServiceManagement, authCredentials.ClientCredentials))
{
organizationProxy.EnableProxyTypes();
}
}
else
{
using (organizationProxy = new OrganizationServiceProxy(OrganizationServiceManagement, responseToken))
{
organizationProxy.EnableProxyTypes();
}
}
IOrganizationService service = (IOrganizationService)organizationProxy;
var context = new XrmServiceContext(service);
if (context != null && mergeOption != null) context.MergeOption = mergeOption.Value;
return context;
}
示例5: GetExecutionPlan
/// <summary>
/// Retrieves the execution plan for the specified merge option and UseCSharpNullComparisonBehavior flag. May return null if the
/// plan for the given merge option and useCSharpNullComparisonBehavior flag is not present.
/// </summary>
/// <param name="mergeOption">The merge option for which an execution plan is required.</param>
/// <param name="useCSharpNullComparisonBehavior">Flag indicating if C# behavior should be used for null comparisons.</param>
/// <returns>The corresponding execution plan, if it exists; otherwise <c>null</c>.</returns>
internal ObjectQueryExecutionPlan GetExecutionPlan(MergeOption mergeOption, bool useCSharpNullComparisonBehavior)
{
string key = GenerateLocalCacheKey(mergeOption, useCSharpNullComparisonBehavior);
ObjectQueryExecutionPlan plan;
_plans.TryGetValue(key, out plan);
return plan;
}
示例6: spVendorInvoices
public virtual ObjectResult<Invoice> spVendorInvoices(Nullable<int> vendorID, MergeOption mergeOption)
{
var vendorIDParameter = vendorID.HasValue ?
new ObjectParameter("VendorID", vendorID) :
new ObjectParameter("VendorID", typeof(int));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Invoice>("spVendorInvoices", mergeOption, vendorIDParameter);
}
示例7: ObjectParameter
public virtual ObjectResult<M_寻呼> M_寻呼_列表(string account, MergeOption mergeOption)
{
var accountParameter = account != null ?
new ObjectParameter("Account", account) :
new ObjectParameter("Account", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<M_寻呼>("M_寻呼_列表", mergeOption, accountParameter);
}
示例8: usp_search_locations
public virtual ObjectResult<Location> usp_search_locations(string search, MergeOption mergeOption)
{
var searchParameter = search != null ?
new ObjectParameter("search", search) :
new ObjectParameter("search", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Location>("usp_search_locations", mergeOption, searchParameter);
}
示例9: usp_area_locations
public virtual ObjectResult<Location> usp_area_locations(Nullable<int> area_id, MergeOption mergeOption)
{
var area_idParameter = area_id.HasValue ?
new ObjectParameter("area_id", area_id) :
new ObjectParameter("area_id", typeof(int));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Location>("usp_area_locations", mergeOption, area_idParameter);
}
示例10: GetStudentGrades
public virtual ObjectResult<StudentGrade> GetStudentGrades(Nullable<int> studentID, MergeOption mergeOption)
{
var studentIDParameter = studentID.HasValue ?
new ObjectParameter("StudentID", studentID) :
new ObjectParameter("StudentID", typeof(int));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<StudentGrade>("GetStudentGrades", mergeOption, studentIDParameter);
}
示例11: GetError_ById
public virtual ObjectResult<Error> GetError_ById(Nullable<int> id, MergeOption mergeOption)
{
var idParameter = id.HasValue ?
new ObjectParameter("Id", id) :
new ObjectParameter("Id", typeof(int));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Error>("GetError_ById", mergeOption, idParameter);
}
示例12: quickSearch
public virtual ObjectResult<letter> quickSearch(string search_terms, MergeOption mergeOption)
{
var search_termsParameter = search_terms != null ?
new ObjectParameter("search_terms", search_terms) :
new ObjectParameter("search_terms", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<letter>("quickSearch", mergeOption, search_termsParameter);
}
示例13: usp_SearchUserByName
public virtual ObjectResult<User> usp_SearchUserByName(string usernamePrefix, MergeOption mergeOption)
{
var usernamePrefixParameter = usernamePrefix != null ?
new ObjectParameter("UsernamePrefix", usernamePrefix) :
new ObjectParameter("UsernamePrefix", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<User>("usp_SearchUserByName", mergeOption, usernamePrefixParameter);
}
示例14: usp_GetEventsByGuid
public virtual ObjectResult<CalendarEvent> usp_GetEventsByGuid(string guid, MergeOption mergeOption)
{
var guidParameter = guid != null ?
new ObjectParameter("Guid", guid) :
new ObjectParameter("Guid", typeof(string));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<CalendarEvent>("usp_GetEventsByGuid", mergeOption, guidParameter);
}
示例15: OfficesInBuildingStoredProc
public virtual ObjectResult<OfficeMf> OfficesInBuildingStoredProc(Nullable<System.Guid> buildingId, MergeOption mergeOption)
{
var buildingIdParameter = buildingId.HasValue ?
new ObjectParameter("BuildingId", buildingId) :
new ObjectParameter("BuildingId", typeof(System.Guid));
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<OfficeMf>("OfficesInBuildingStoredProc", mergeOption, buildingIdParameter);
}