I have created an API, using EF and database first approach via scaffolding. I have the following in my context file and then the following in my models Request: Request Line: My Request controller looks like this: In Swagger, it is displayed correctly in the example, based on the model: But when running the GET, what I am actually seeing
Tag: entity-framework
Problem with creating a SQL view with multiple joins
I am trying to create a view which will be a base for Excel export in API. Basically, what it contains is information about particular projects. To said projects calculations can be added (it all happens on the form on frontend). Those calculations are called EBIT, EBIT+ and OVI. User can add either one, two or all of them, so
How to get a list of all Table names through asp.net API controller
So I want to get a list of all the table names from the database through a controller as an ASP.net API project. I tried to do it through raw sql query without entity and it looked something like this. But when I try to use the SqlQuery method I get the error ” ‘DatabaseFacade’ does not contain a definition
How to use Distinct in entity/linq based on certain columns (Remove duplicated values)
I want to remove the duplicated values from the columns ” 1)LabelName, 2)OpenLabelStandard, 3)Type “. The issue is that my table has four columns. beside to the three previous columns I have another one called 4)’Distance’. it is not a field from database. I added it to my table using some calculations in view model. the distance column is changeable
Error – NetTopologySuite( When writing a SQL Server geography value, the shell of a polygon must be oriented counter-clockwise)
All, I’m using NetTopologySuite/ Entity Asp Core for my project. I want to create a radius of 1000 meter for the ‘searchArea ‘ When I’m running the the app it gives me an error : System.ArgumentException: When writing a SQL Server geography value, the shell of a polygon must be oriented counter-clockwise. My View ps: I could achieve this query
How to get output parameter and also a table when executing a stored procedure
Scenario I’m working with SQL Server 2017 (not possible to change) I’m using Visual Studio 2019 in C# console and .NET Framework 4.5 (possible to change) I’m using ADO.NET because several years before we couldn’t use Entity Framework, as the system is made to work with a stored procedure that returns at least 100k rows (possible to change) Situation I
Base on SQL column content insert the data into another table
I have below table name: CustomerContent with the below image data and My product is:is common in ProductContent cell. First colon no need to split (My product is:) if next colons we need to split the ProductContent Cell base text assign the values like below. If slip data content CGM then assign value 37. my table I need output like
Select Min() and other columns and GroupBy by two columns in EF 6
Using the example below, (from the answer in this link here) how can I select/group with an extra column ? I have searched this site and others and tried some examples but couldn’t get it to work. Answer It sounds like what you want would be: Then in the .Select() This groups on distinct combinations of rate class and vehicle
Convert html foreach loop data to webgrid using asp.net mvc
Below html table is filling using two loop condition, and same i want using two loop conditions to fill Webgrid I have tried to fill one field in web grid by using below code. when I am click debugging mode after code line complete on this line the following error is showing. Answer The exceptions you’ve included in your question
Convert sql query to EF
Can anybody please help with this SQL query to transform it to EF Linq Expression? I’ve been trying to do this for days, so I could really use some help. Do you need extra info? Thank you in advance. Edit Here is a little part of the diagram, maybe it helps Answer It seems the subqueries in both of your