Context
I would like to create a custom Entity using the Dynamics 365 WebAPI. When reading the official documentation Create and update entity definitions using the Web API I can not find traces where to set which Solution is the target of the Entity Creation
Question
How and where to set in which Solution is the target the Create Entity operation?
It would appear that after creating the entity you could use the Web API's Add Solution Component Action.
In this article, David Yack has an example of using this action to add a Web Resource to a Solution via his Web API helper library.
This article lists the component types. Entity is 1.
Related
I am starting to work on a new project so working on laying on the architechture at this moment.
So basically we want to keep a service oriented architecture using MVC web api.
So I had the following structure in mind:
Project.Core (All Poco classes)
Proect.Data (All entity framerwork)
Project.Service (All Web API ??)
Project.Web
We would be working for the first time on webapi here. So wanted to know how do we intergrate webapi here.
Most of the articles we saw read had created a mvc web application and had selected webapi in that. But we
were looking to create separate service layer just for webapi. Is this the correct practice to do that or
I am missing something here.
We basically wanted not to have a tight coupling b.w MVC web and web api here. If we create web api as part
of mvc then how can we separately access our web api.
WOuld appreciate inputs.
I normally use the project template provided by Visual Studio. Choose Empty ASP.NET project template and then select Add folders and references for Web API. It will create the folder structure needed/recommended purely for a Web API project without any MVC reference. I generally create a separate project for Data Access and use that from the Web API project.
I am creating OData endpoints using ASP.NET Web API using v5.8.0 of this NuGet package. I have everything working and I can retrieve simple data such as strings and ints without an issue. However I would now like to extend one of the endpoints so that one of the items that can be retrieved is a binary image file. Having read up on OData I have decided to use named resource streams to achieve this.
The problem I have is that I can find very little information on how to implement this using the ODataController. The closest I can find is this blog post but it is using an older version of Web API and the code does not compile when I use it in my project.
So can somebody please supply a working example of how this should be implemented please.
Named streams (aka stream properties) are not currently supported in Web API OData (for OData v4). See the following issues:
Clarify the situation for streams
Document for Stream Support in OData V4
I have a lighweight setup where I am using Web API 2 with OData but do not create an "/odata" endpoint with its accompanying "/odata/$metadata" but instead just use standard ApiController's with attribute routing and Get methods marked with an override of [Queryable]: [InlineCountQueryable] detailed here Web API, OData, $inlinecount and testing.
It all works very well except that I can only expose dedicated model classes without any collections or object properties because the JSON serializer serializes the whole object graph. My ideal behavior would be to just have all collections ignored completely and object properties only included on $expand.
I believe this can be made to work because an OData Web Api 2 scaffold VS 2013 creates over an entity framework context has similar behavior, but I would like to keep this as lean as possible and avoid going that route as I found it to be a bit brittle and this service does not need to expose a $metadata description.
Update
I did some digging in the aspnet samples and found the "CustomODataFormatter" sample which seems to expose the machinery I would need to modify.. however the ODataSerializerProvider/ODataSerializer setup outlined there does not work with with attribute routing at all (any method defined with [Route("Some/Url")]).
Given that this seems to be what I need, does anyone know if attribute routing and the odata serializer provider mechanism should work together?
[JsonIgnore] or [DataMember] can be used to ignore properties for json.net serializer. webapi.odata 5.2 supports ODataRouteAttribute, an example is here.
I have a MVC web application that I am using my own membership provider. I have implemented the Entity Framework with POCO’s, repositories, and a unit of work to both the MVC app and the Custom Membership Provider.
I am finding that when the data changes outside of the entity created in the membership provider, the data is not updated. The system works fine when the entities are short lived in a web request, but the membership provider is started with the web application and is not disposed like a controller.
I have read every post I could find and have not found how to overcome this limitation of Entity Framework. Do I have to resort to the old ADO code to get the latest data from the database?
Make sure you have overrided WebSecurity and other Microsoft Membership Provider classes at the right way. For Security reasons and the Architecture of Entity Framework, may not happen appropriate coordination among those. A good example for implementing sample membership provider with Entity Framework and Asp.net Membership provider can be found at The nuget gallery. I wish to be useful for you.
I have a MVC3 project that is referencing a WCF web service....and that WCF service references a data class library.
When I try to scaffold a controller, I have the option to select a Model class from a drop-down.
I would expect to see the data classes that are defined in my data class library, but they're are none there. I'm puzzled by this. I thought that because the MVC project is referencing a WCF service that is referencing the data class library that the classes would be available to choose from.
Am I missing something?
I had what sounds like the same problem. Take a look at this answer and verify you don't have the exact same thing happening Attempting to add a strongly typed view does not find any classes in the MVC project