feat: Add SrushtiAPI - .NET Core Web API with CRUD for Sales, Purchase, and Employee#68
Open
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Open
feat: Add SrushtiAPI - .NET Core Web API with CRUD for Sales, Purchase, and Employee#68devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
devin-ai-integration[bot] wants to merge 2 commits intomasterfrom
Conversation
…hase using Repository Pattern and Dapper - Models: Sales, Purchase - Repository interfaces: ISalesRepository, IPurchaseRepository - Repository implementations with Dapper ORM - Controllers: SalesController, PurchaseController with full CRUD - DapperContext for database connection management - SQL schema script for Sales and Purchases tables - Dependency injection configured in Program.cs - Swagger/OpenAPI documentation enabled
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
- Model: Employee (FirstName, LastName, Email, Phone, Department, Designation, Salary, DateOfJoining) - Repository interface: IEmployeeRepository - Repository implementation: EmployeeRepository with Dapper - Controller: EmployeeController with full CRUD endpoints - Updated DatabaseSchema.sql with Employees table - Registered IEmployeeRepository in DI container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new .NET 8 Web API project (
SrushtiAPI/) implementing CRUD operations for Sales, Purchase, and Employee entities using the Repository Pattern with Dapper as the micro-ORM.Project structure:
Models/—Sales,Purchase,Employeeentity classesRepositories/Interfaces/—ISalesRepository,IPurchaseRepository,IEmployeeRepositoryRepositories/—SalesRepository,PurchaseRepository,EmployeeRepository(Dapper implementations)Controllers/—SalesController,PurchaseController,EmployeeController(full CRUD: GET all, GET by id, POST, PUT, DELETE)Data/DapperContext.cs— Connection factory usingMicrosoft.Data.SqlClientData/DatabaseSchema.sql— SQL Server DDL script forSales,Purchases, andEmployeestablesProgram.cs; Swagger enabled in Development modeReview & Testing Checklist for Human
TotalAmounton Sales/Purchase is accepted from the client rather than computed server-side fromQuantity × UnitPrice. Verify this is the desired behavior — it allows clients to submit inconsistent totals.[Required],[Range],[EmailAddress], etc.). Invalid or empty payloads will reach the database layer and fail there.Trusted_Connection=True(Windows Auth) — updateappsettings.jsonwith actual SQL Server credentials before deploying or testing on non-Windows environments.SrushtiAPI.httpstill references the old/weatherforecast/endpoint from the template — should be updated to/api/Sales,/api/Purchase, and/api/Employeeif this file is kept.DatabaseSchema.sqlagainst a SQL Server instance, update the connection string, thendotnet runinsideSrushtiAPI/. Verify all endpoints via Swagger UI athttp://localhost:5229/swagger— create, read, update, and delete records for Sales, Purchase, and Employee.Notes
DapperContextstores an unused_configurationfield (only_connectionStringis used after the constructor).Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/083835991649441e801ad6578317fd14