‫۱۲ سال و ۳ ماه قبل، پنجشنبه ۱۵ تیر ۱۳۹۱، ساعت ۲۲:۲۷
سلام جناب نصیری
یه سوال
نحوه ارتباط wcf با model در mvvm با فرض استفاده از تکنولوژی code first به چه صورت است ؟
آیا از DomainClasses می‌توان به عنوان model در mvvm استفاده کرد ؟
با تشکر
‫۱۲ سال و ۳ ماه قبل، چهارشنبه ۱۴ تیر ۱۳۹۱، ساعت ۲۳:۵۵
سلام جناب نصیری
ممنون از پاسخگوئیتون
مواردی رو که شما فرمودید انجام دادم( رشته اتصالی به بانک اطلاعاتی در web.config از قبل درست بود) با سه حالت مختلف 
1- فقط از متد Database.SetInitializer در روال Application_Start  استفاده کردم که با خطای زیر مواجه شدم 
GenericArguments[0], 'DataLayer.TestContext', on
'System.Data.Entity.IDatabaseInitializer`1[TContext]' violates the 
constraint of type parameter 'TContext'.
2- از متد Database.SetInitializer صرف نظر کردم و موارد زیر رو به  web.config اضافه کردم
<contexts>
    <context type=" DataLayer.TestContext, DataLayer">
      <databaseInitializer type="System.Data.Entity.DropCreateDatabaseAlways`1[
                           [DataLayer.TestContext, DataLayer]], EntityFramework" />
    </context>
  </contexts>
که با خطای زیر مواجه شدم
An error occurred during the processing of a configuration file required to service this request.
Please review the specific error details below and modify your configuration file appropriately
3- فقط از <appSettings>  استفاده کردم که بدون هیچ خطا و هشداری بود ولی باز هم دیتابیس تشکیل نشد.  
با تشکر



‫۱۲ سال و ۳ ماه قبل، چهارشنبه ۱۴ تیر ۱۳۹۱، ساعت ۱۴:۴۶
سلام جناب نصیری
ببخشید سوالات من در سطح پائینیه و وقت شمارو هم میگیره ولی خوب....
پروژه من بصورت زیر تعریف شده :
1- MVVMLight SL5 بدون هیچ هاستی
2- Wcf service که تو این پروژه اومدم هاست رو تعریف کردم و همچنین پروژه SL رو در Properties این قسمت Add کردم
3- دو پروژه مجزا مطابق با درس شما DataLayer و DomainClasses
پروژه بعد از Run شدن دیتابیس رو تشکیل نمیده ضمن اینکه هیچ خطا یا هشداری هم ندارم.
لطفا در صورت فرصت راهنمائی بفرمائید.
با تشکر
‫۱۲ سال و ۳ ماه قبل، یکشنبه ۱۱ تیر ۱۳۹۱، ساعت ۰۴:۲۹
سلام جناب نصیری
سیلور 5 از code first پشتیبانی نمیکنه ؟ موقع نصب از nuget پیغام میده که 
Could not install package 'EntityFramework 4.3.1'. You are trying to install this package into a project that targets 'Silverlight,Version=v5.0', but the package does not contain any assembly references that are compatible with that framework. 
‫۱۲ سال و ۴ ماه قبل، دوشنبه ۲۹ خرداد ۱۳۹۱، ساعت ۱۵:۳۳
با سلام و تشکر
جناب نصیری این مورد رو هم قبلا چک کردم که با پیغام خطای زیر مواجه شدم
Silverlight does not enable you to directly enumerate over a data service query.
This is because enumeration automatically send a synchronous request to the data service.
Because Silverlight only supports  asynchronous operations, you must instead call BeginExecute and EndExecute method to obtain a query result that supports enumeration. 
‫۱۲ سال و ۴ ماه قبل، دوشنبه ۲۹ خرداد ۱۳۹۱، ساعت ۰۴:۵۰
سلام جناب نصیری
من تو پروژه سیلور از OData استفاده کردم. وقتی می خواستم Max یک ستون رو برگردونم با پیغام زیر مواجه شدم.
.NotSupportedException: The method 'Max' is not supported
ظاهرا بعضی از متدها موقع کوئری نوشتن (LINQ to Entities) با OData و WCF سازگار نیستن و ساپورت نمیشوند.(البته تا جایی که من سرچ کردم و یه چیزایی فهمیدم).
This topic provides information about the way in which LINQ queries are composed and executed when you are using the WCF Data Services client and limitations of using LINQ to query a data service that implements the Open Data Protocol (OData). For more information about composing and executing queries against an OData-based data service, see Querying the Data Service (WCF Data Services).
Composing LINQ Queries
LINQ enables you to compose queries against a collection of objects that implements IEnumerable. Both the Add Service Reference dialog box in Visual Studio and the DataSvcUtil.exe tool are used to generate a representation of an OData service as an entity container class that inherits from DataServiceContext, as well as objects that represent the entities returned in feeds. These tools also generate properties on the entity container class for the collections that are exposed as feeds by the service. Each of these properties of the class that encapsulates the data service return a DataServiceQuery. Because the DataServiceQuery class implements the IQueryable interface defined by LINQ, the WCF Data Services you can compose a LINQ query against feeds exposed by the data service, which are translated by the client library into a query request URI that is sent to the data service on execution.
 Note:
The set of queries expressible in the LINQ syntax is broader than those enabled in the URI syntax that is used by OData data services. A NotSupportedException is raised when the query cannot be mapped to a URI in the target data service. For more information, see the Unsupported LINQ Methods in this topic.
لطفا اگر امکانش هست راهنمائی بفرمائید و اینکه حالا که ساپورت نمیشه چه راه حلی وجود داره برای Max گرفتن.
با تشکر