Почему методы DomainService, которые имеют параметры сложных типов (все типы, кроме int, bool, float, ...), не распознаются в Model?
в строю и даже в интеллекте! (
Обновление
КОД
namespace KhorasanMIS.Web.Services
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Data;
using System.Linq;
using System.ServiceModel.DomainServices.EntityFramework;
using System.ServiceModel.DomainServices.Hosting;
using System.ServiceModel.DomainServices.Server;
using KhorasanMIS.Web.Entities;
// Implements application logic using the KhorasanMISEntities context.
// TODO: Add your application logic to these methods or in additional methods.
// TODO: Wire up authentication (Windows/ASP.NET Forms) and uncomment the following to disable anonymous access
// Also consider adding roles to restrict access as appropriate.
// [RequiresAuthentication]
[EnableClientAccess()]
public class DSCountry : LinqToEntitiesDomainService<KhorasanMISEntities>
{
// TODO:
// Consider constraining the results of your query method. If you need additional input you can
// add parameters to this method or create additional query methods with different names.
// To support paging you will need to add ordering to the 'Countries' query.
public IQueryable<Country> GetCountries()
{
return this.ObjectContext.Countries;
}
public IEnumerable<Country> GetCountryByCode(string pCode)
{
return this.ObjectContext.Countries.Where(a => a.ISOCode.Equals(pCode));
}
public bool IsValidEdit(string pCode)
{
List<string> message = new List<string>();
IEnumerable<Country> list = GetCountryByCode(pCode);
if (list.Count() > 0)
{
return false;
}
return true;
}
//***********************************************************
public bool Update(Country currentItem)
{
this.ObjectContext.Countries.AttachAsModified(currentItem, this.ChangeSet.GetOriginal(currentItem));
return true;
}
//***********************************************************
}
}
Метод в комментариях к звездам нельзя использовать в модели, но если я изменю его параметр на int, он станет пригодным для использования.