I have been trying to figure out how to add a ...Where... clause to this. I need ...Where OrderHeader.OrderStatus = "NEW"
...Any help is a appreciated. ...using (context)
{
var orderData = context.OrderHeaders
.Join(conte...
I need some suggestions that how to improve this below query....from o in this.DbContext.Set<School>().AsNoTracking()
from s in o.Teachers.DefaultIfEmpty()
where SchoolCodes.Contains(o.Code)
select new TabularItem
{
SchoolId = o.Id,
SchoolCode = o...
I cannot get values from database using stored procedure. Please see code below:...class LaneModel
{
public string Name { get; set; }
public int Lane { get; set; }
public int ManualCount { get; set; }
public int ReadCount { get; set; }
...
Just installed ODAC for Visual Studio 2017 version 19.3 from here: ...https://www.oracle.com/database/technologies/dotnet-odacmsi-vs2017-downloads.html... to replace ODT for Visual Studio 2017 NuGet Package. Then I noticed my Oracle NuGet packages were go...
I have an ASP.NET Core application running as a Windows Service. Due to project requirements, I am using Entity Framework v6.3 (as opposed to using EF Core). ...I am having trouble retrieving the correct connection string when performing a migration. ...A...
I have an Azure V3 app that must call DAL repos built on Entity Framework 6.4
On database initialize I am getting an exception: ...System.Data.SqlClient: System.Data.SqlClient is not supported on this platform...That is coming from: ...System.Data.SqlClie...
I want to insert a single record into a table with 60 columns (some of them are not required) and 2 million records. It takes about 20 seconds....var package = new Package()
{
DestinationCityId = city.Id,
OriginCityId = RequestDe...
I need to check whether the provided keyword is present in the day-name of a date in the db. I have done it by using dynamic query....ArrayList paramList = new ArrayList();
int paramCount = 0;
StringBuilder queryString = new StringBuilder();
if (keyword ...
We have an EDMX-based EF6 application, where we'd like to run a LINQ query like this....string category = ... // comes from somewhere and equals to null
context.Product.Where(e => e.Category == category).ToArray();
...The problem I see is that the generat...
Evening all,
I was hoping that someone could help me along with a project that I am working on....Just before I really start, I just want to make it absolutely clear, I have never done anything like this before past dabbling at home, I am not a C# develo...
I am currently struggling to figure out how I can order a query by a field that only has a getter. I have an ...IQueryable... being built as follows:...var referrals = db.Referrals
.Include(x => x.Doctor)
.I...
I developed an application with entity framework. I get the ...The ObjectContext instance has been disposed and can no longer be used
for operations that require a connection....error from sometimes....I did some research on the internet but I couldn't ...
I need to write this SQL statement in Entity Framework:...SELECT
SALARIE.MATRICULE, LIEU, UO, UO_RATTACHEMENT,
PHOTO.PHOTO, SALARIE.NOM, SALARIE.PRENOM
FROM
SALARIE, UNITE_ORG, PHOTO
WHERE
SALARIE.LIEU = UNITE_ORG.UO
...I use this metho...
I'm working to move our model over to EF Core and I'm having trouble finding a way to call the following code:...InitializeTime = context.ExecuteSqlCommand<DateTime>("SELECT CURRENT_TIMESTAMP FROM DUAL").FirstOrDefault();
...We use the database time to sy...
I have the following LINQ query which is working great :...public IList<Course> GetEmployeeCourses(int id) {
var employeeCourses = Context.Employees
.Where(e => e.Id == id)
.SelectMany(e => e.employeeCourses.Select(ec => ec.Course))
.ToList(...
I'm using EF6 with ASP.Net. I'm trying to add items to the Jobs list in the following model:...EDIT: ...My goal is to save the changes I make to the Timecards.Jobs list through a PUT method in such a way that I can retrieve them through a GET method....pu...
I have a software that has been in the works for a while, today our client decided we NOT delete any data but instead hide them. To do this, I plan to add an "isDeleted" property to all tables and change all methods for deletion to set this property to "t...
I need to select the last record of particular columns. I have the following records...WarehouseId | ItemId | SubItemId | DeliveryGroupId | Other Columns
1 | 1 | 1 | 1 | ...
1 | 1 | 1 | ...
When i update database in package manager console i have this error...Introducing FOREIGN KEY constraint 'FK_dbo.Appointments_dbo.Users_AppointmentManagerId' on table 'Appointments' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION o...
I have two sets of objects: ...Coupon... and ...DiscountScheme.......
Each have a connected object of ...{Type}Action..., and identical configurations....
When making a request for ...Coupon..., I do not get anything back,
but the same query for ...Discou...