Questions tagged [data-access-layer]

Data access layer is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database.

0
votes
1answer
16 views

How to pass values to DataAccess Layer for storing into database in asp.net MVC5 API?

In my API application, I field values coming from registration view which I want to store into the database. On AccountController.cs, I have collected these values using the following code. [Route("...
0
votes
1answer
54 views

.Net Web Api: Why should I install Entity Framework on my Web Api controllers project?

I have a multi-layer .Net Web Api project where (apart from the Web Api layer itself) I have a DAL which will do all database operations (I'm working with Oracle). For that I've configured Data ...
-1
votes
1answer
42 views

Using a Data Access Layer in an OOP C# application using SQL

I have come from an environment where I was taught to use objects and employ OOP techniques where possible and I guess it has guided me down a particular road and influenced my product designs for ...
1
vote
1answer
18 views

How to efficiently filter large amount of records based on user permissions on specific records with specific criteria?

I'm working as a maintainer for a legacy Java-based cargo railway consignment note accounting system. There is a serious performance issue with retrieving a list of consignment notes to display on ...
0
votes
1answer
12 views

Is there a way to standardize the business datatypes across all systems in organization?

Can we do a loosely coupled data access layer design in python? Lets say,in a scenario i have an oracle table with column name ACTIVITY_ID with column datatype as Number(10). If this column is a ...
-2
votes
2answers
30 views

Is it good way to inject a Service into DAO in java

I have a scenario where i need to call some service in the DAO layer to fetch some data based on a input coming from the database(in the resultset). so what best to way to instantiate the service. ...
1
vote
2answers
66 views

Call an Oracle Function from C# with Nulls

I'm trying to call an Oracle Function from our C# application, but I either get the following errors. I think I have two problems: I want to call this function, but some of the parameters can be ...
2
votes
2answers
148 views

How to implement the Business Logic layer and the Repository Layer with Java Spring Boot?

I am trying to create the Business Logic (Service) and the Repository (Data access) Layer for my application. I want to do it correctly but I am not an expert. For the moment, for the Repository ...
0
votes
2answers
96 views

C# Winform - DAL and BLL - usage of static methods is good?

The doubt I am encountering is regarding the usage of static methods during the implementation of DAL and BLL access layer in a winform application. I know that there are many articles here regarding ...
0
votes
0answers
17 views

Invalid entity on context.set

How can I check if a dynamic DbSet created with context.set exists on the context ? I want to throw an exception if TEntity doesn't have an existing set in the context.
0
votes
1answer
61 views

DTO, Data Layer and types to return [closed]

At my job we use Entity Framework for data access. I am creating a Data Access Layer, a Business Access Layer and a few different types of projects to access the BLL (webAPI for client applications to ...
2
votes
1answer
127 views

Separate Data Access Layers for Distributed Compute

Overview Currently my product maintains a DAL that is separated from business logic and exposed via a set of services where each service generally corresponds to an element i.e. Car objects are ...
0
votes
1answer
36 views

MVC Business Logic + DAL + Mapping ViewModel with EF Model

I'm starting to develop an application, and I want to know the best practices to organize the architecture of the solution. Should I use EF Class Model as my ViewModel? Should I put all my queries ...
0
votes
0answers
39 views

ASP: Mapping SQL Query Results to Model Classes

I'm working on a C# ASP.NET project which follows the 3 tiers architecture. I have four sub projects within the solution. Presentation Layer (Contains ASP pages which use the business layer) Business ...
0
votes
2answers
36 views

Firebase Back-end code arrangement in Android Studio

I am working on a college project, my team and I are developing an application that includes users and groups, we are using Firebase for signing-up using Facebook, and almost every activity needs to ...
0
votes
0answers
46 views

Entity Framework not sending WHERE clause to the SQL Server database [duplicate]

We use Entity Framework for data access, the following function is for fetching data based on where clause: public virtual T GetSingle(Func<T, bool> where, params Expression<...
0
votes
1answer
170 views

How to Dependency inject Data Access Layer which takes database settings in it's constructor?

I wrote a simple Data access interface with generic CRUD operations so that every database repository has to implement this interface. For now I implemented this interface for one database say SQL. ...
0
votes
0answers
24 views

Extend an application DB support from SQL Server via Entity Framework to MongoDB

Our C# application currently works with SQL Server via Entity Framework, and we would like to migrate our DB to a NoSQL database. However we would still like our application to be able to work with ...
0
votes
0answers
17 views

Setup Visual Studio 2012 “The type or namespace name 'DAL' could not be found”

I am building a new website in C# in Visual Studio 2012. I want to access some tables in my SQL Server 2012 db. I have a DAL folder where I added the tables (*.dbml file), I have setup the connection ...
0
votes
1answer
215 views

Layered Design /Architecture

we use html 5/angular SPA with Webapi at the service which communicates with DAL for dataaccess operations Layer flow would be: presentation(html5/angular controllers/service) --> web api --> DAL - -...
0
votes
1answer
31 views

Accessing and populating another class's properties in DAL BLL setup

I'd like to return in BLLServiceRequests the DALServiceRequest properties along with its corresponding DALRequest properties since the SP I used is a JOIN table between Request and ServiceRequest ...
0
votes
1answer
37 views

Can MyBatis be used with SAP Hybris database?

Is it possible to use MyBatis on top of an SAP Hybris database? Or does this require some customization to use SAP BAPIs/Interfaces, ...?
2
votes
3answers
251 views

What is the difference between ORM and DAL?

I have read up on both, but it has just confused me more. I have tried to find the differences (and similarities), but am unable to convince myself. Both of them are an intermediate layer between the ...
0
votes
3answers
94 views

How to avoid that Entity Framework must be installed for each project which uses the DbContext

I have a solution which contains several UI projects and a bunch of common (shared) DLL projects. There also is a "DB access project" based on EF which contains the models and DbContext and is ...
1
vote
1answer
69 views

Do we have the database access layer to easily switch to other databases in Scala

Requirement: I am developing an IoT related application using Scala. In this application, I have to implement the list of APIs for multiple modules. For Example, I 'll take the User module. In the ...
1
vote
1answer
148 views

xUnit for test DAL in .net core 2 and DI- a little bit of confusion

I a little bit of confusion about xUnit for test my DAL. My goal is to verify that my DAL correctly accesses the DB and extract the right data. I create a xUnit test project and try to do a simpli ...
2
votes
2answers
246 views

Data access layer patterns using azure function

We are currently working on a design using Azure functions with Azure storage queue binding. Each message in the queue represents a complete transaction. An Azure function will be bound to that queue ...
2
votes
1answer
92 views

Separation between data and logic for sqlalchemy models

In the following example, should I keep the get_friend method inside my class or should I move it outside because I want to separate data structure from business logic ? What's the best practice ? Don'...
3
votes
1answer
281 views

Db Manager class for third tier (Data Access Layer) in asp.net

I am following 3-tier architecture for building a website. For this I created a class named DB Manager. Here is the class namespace DAL { class DBManager { private static DataTable ...
-1
votes
1answer
90 views

Recommendations on passing data obtained from a data store to the business layer

I'm trying to develop a Data Access layer in .NET, C# to be specific, without the use on entity framework, just ADO.NET. In this case the data is coming from a database. I'd like to keep the data ...
1
vote
0answers
34 views

Separate Data Mapper on Deeper Level & Single Action Class

I've seen lot of DataMapper example been made like this: namespace DataMapper; class UserMapper { protected $pdo; public function __construct(\PDO $pdo) { $this->pdo = $pdo; ...
0
votes
2answers
43 views

How to handle on-demand data fetching for Domain Models

Given the following scenario... I am concerned about two things... 1) Is it okay to inject a provider into a business model object? - like I did with the Folder implementation because I want to load ...
-1
votes
3answers
56 views

Select where not exist in interval ? Different between four dates

In the first the business is car rental system . I want to get all car where has no orders in interval selected by user public List<Car> SearchCar(DateTime pickdate, DateTime dropdate) { ...
-2
votes
2answers
112 views

Web Service for SQL server [closed]

Note: This question is not an Error in code question its a general question for information on Web-Service connecting to the database. I am new to development and I need to know why should you use ...
1
vote
0answers
36 views

extensible design for DAL design

I have started to design my own Data Access Layer for a little bit large project. I'm using EF 6.0 and i'm using DB First method to save/retrieve data to/from database. Here is my design for one of ...
0
votes
1answer
33 views

Best approach to Insert Composite relation in DAL

I'm creating a custom DAL to persists and get data from database. For single entities there is no problem. But I need an implementation for related entities. This is a composite relation. For example,...
2
votes
0answers
175 views

Best practice of Instantiating a DAL object in MVC model implemented in PHP

I am learning the popular MVC and trying to implement it in PHP. I am designing a framework with a pure OOP fashion (though I am not expert in PHP's OOP ability. I only have moderate knowledge about ...
1
vote
2answers
187 views

.net generic repository issue with petapoco

I have N-Layer solution in .Net with PetaPoco as microORM. I get the entities generated from the template generator of PetaPoco. These entities T derive from the base class Record<T>. Then I ...
1
vote
1answer
196 views

Login Form With Entity Framework and 3 layer architecture

I want to write a login form. How much my code is correct? please guide me. PhonebookDatabaseEntities context = new PhonebookDatabaseEntities(); public bool Accunt(string username ,string password) ...
2
votes
2answers
88 views

In a DDD oriented microservice the Infrastructure and Entities can be reused?

I'm thinking in a DDD oriented microservice architecture as described in this article (https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/microservice-ddd-cqrs-patterns/ddd-...
-1
votes
1answer
171 views

C# Entity Framework - Social Network - Friendship, Chat Entity

I am trying to do a database model for my social network school project. I am using Entity Framework 6. The problem is how should I model my Friendship and Chat entity. I get this error: ...
0
votes
1answer
435 views

What are the best practices working with Oracle.DataAccess.Client?

I'm going over a lengthy data access code of a somewhat older app. Every function is calling a stored procedure to select something from Oracle DB. Every function more or less looks like the code ...
0
votes
1answer
222 views

Where to hide a connection string in Windows Forms?

Where would you recommend hiding or writing a connection string in a winforms desktop app? I have a DAL (data access layer) where I hardcoded it for the time being, but I know it shouldn't be there. ...
1
vote
1answer
80 views

Best practices to Minimize/Manage SQL string blobs in data access code (e.g. Dapper)

I've built some data layers using Dapper with great pleasure. Of course maintaining the required SQL strings can be an issue, especially when the db schema changes (rename column etc). I'm looking ...
1
vote
3answers
480 views

Entity Framework with Repository Pattern, inserting data to tables with many-to-many relationship

I am trying to build a three tier architecture with BLL, DAL, and UI. I am working on a small Apartment Management System project (which includes the information about resident students, their rooms ...
1
vote
1answer
45 views

How to separate the Data Access Layer into smaller classes

I have a design problem with a 3 Tier application. Usually my database layer is only 1 class like this one: public class DA { string _connString = ""; public DA() { _connString =...
1
vote
1answer
395 views

What is DTO equivalent term for objects returned from DAL?

I'm already using DTO's for data transfer over a network. Now I'm also introducing different DTO-like classes to the DAL. This is to avoid passing the application (business) objects across layers. To ...
0
votes
1answer
84 views

Is it possible to use commandType = text to call a stored procedure using System.Data.OracleClient

I am using System.Data.OracleClient to connect to an Oracle database using Enterprise library and I would like to call a stored procedure using the commandType = Text as follows: Microsoft.Practices....
-3
votes
3answers
245 views

Generic method that returns list [closed]

We are developing Data access framework library to be called by Business components to access SQLlite DB for Xamarin app. To execute SELECT Sql against DB, following method have been written. Am new ...
1
vote
1answer
47 views

Feed restier from external DBcontext

I have separate DAL and need to feed restier controller from it. Is it possible to use dbcontext from another assembly ? also I am trying it but getting error on connection string to dbcontext.