0% found this document useful (0 votes)
51 views6 pages

Crud Web Api Entity Framework

This document provides an overview of files and code structure in a .NET project called UseEntityAPI. It shows the project contains models, controllers, and data context files related to managing contact data. The solution explorer lists the files and their relationships, including a Contacts model with properties for contact details, a ContactsController for handling requests, and a ContactsAPIDbContext for interacting with the database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views6 pages

Crud Web Api Entity Framework

This document provides an overview of files and code structure in a .NET project called UseEntityAPI. It shows the project contains models, controllers, and data context files related to managing contact data. The solution explorer lists the files and their relationships, including a Contacts model with properties for contact details, a ContactsController for handling requests, and a ContactsAPIDbContext for interacting with the database.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

D File Edit View Git Project Build Debug Test Analyze Tools Extensions Window Help Search (Ctrl+

ls Extensions Window Help Search (Ctrl+ Q) UseEntityAPI Sign in A


-Debug Any CPU
IS Express a | : | Live Share
UpdateContacts,cs AddConta ctRequest.cs ContactsController. cs ContactsAPIDbContext.cs Contacts.cs X 7Solution Eplorer
9UseEntityAPI -UseEntityAP.Models.Contacts
1 Eusing System;
-Pld
using System.Collections. Generic; Search Solution Explorer (Ctrl+)
using System. Linq;
4
using System. Threading. Tasks; Solution 'UseEntityAPI' (1 of 1project)
5 4 UseEntityAPI
6 Enamespace UseEntityAPI.Models G Connected Services
7
2 references
Dependencies
y Properties
public class Contacts
9 Controllers
1 reference C ContactsController.cs
10 public Guid Id { get; set; } WeatherForecast Controller.cs
2 referencas Data
11 public string Name get; set; } ContactsAPIDbContext.cs
2 references
Models
12 public string Email { get; set; }
2references = AddContactRequest.cs
13 public string Mobile { get; set; } c= Contacis.cs
2 references
14
C- UpdateContacts.cs
public string Address { get; set; }
15 D J appsettingsjson
16 C Program.cs
17 - Startup.cs
c- WeatherForecast.cs

0% No issues found
Ln: 9 Ch: 6 SPC CRLF Solution Explorer Git Changes
dy
File Edit View Git Project Build Debug Test Analyze Tools Extensions Windaw HelpSearch (Ctrl+0) UseEntityAPI Sign in A

-0- - - Debug Any CPU IS Express E Live Share

UpdateContacts. cs AddContactRequest.cs X ContactsController. cs ContactsAPIDbContext. cs Contacts. cs Solution Explorer Notifications


Diagnostic
loolE
UseEntityAPI UseEntityAPI.Models.AddContactRequest Name
Eusing System;
using System.Collections.Generic; Search Solution Explorer (Ctrl+)
using System. Linq; Solution 'UseEntityAPI (1 of 1 project)
using System.Threading. Tasks; E UseEntityAPI
Connected Services
6 Anamespace UseEntityAPI.Models
Dependencies
1 reference Properties
8E public class AddContactRequest Controllers
9 C# ContactsController.cs
1 reference
c WeatherForecastController.cS
10 public string Name { get; set; Data
1 reference
11 public string Email { get; set; c ContactsAPIDbContext.cs
1 reference Models
12 public string Mobile { get; set; C# AddContactRequest.cs
1reference C Contacts.cs
13 public string Address { get; set;} c# UpdateContacts.cs
14
15 Uappsettingsjson
16 C+ Program.cs
C Startup.cs
C VWeatherForecast.cs

100%G No issues found Ln: 8 Ch: 35 SPC CRLF Solution Explorer Git Changes
Add to SourCe Cotrol
Extensions Window Search (Ctrl+Q) UsetntityAPI
Build Debug Test Analyze Tools Help
Edit View Git Project J Live Share
IIS Express
-01 8 - H - - Debug Any CPU

ContactsSAPIDbContext. cs Contacts.cs Solution Explorer


UpdateContacts.cs X AddContactRequest.cs ContactsController.cs
Name
UseEntityAPI UseEntityAP.Models.UpdateContacts
Search Solution Explorer (Ctrl+;)
Ausing System;
using System.Collections.Generic; Solution 'UseEntityAPI' (1 of 1project)
3 using System. Linq; UseEntityAPI
4 using System.Threading.Tasks; Ù Connected Services
Enamespace UseEntityAPI.Models H Dependencies
6
7 Properties
1reference Controllers
public class UpdateContacts C ContactsController.cs
c WeatherForecastController.cs
1 reference
public string Name get; set; } Data
1reference c ContactsAPIDbContext.cs
11 public
1refar string Email get; set; } Models
erence
12 public string Mobile get; set; } c AddContactRequest.cs
1referen cH Contacts.cs
13 publicstring Address get; set; } C Update entacts,CS
14 6J ppSettingsjson
15 C# Program.cs
16
CH Startup.cs
C# WeatherForecast

1009% No issues found Ln: 9 Ch: 6 SPC CRLF Solution Explorer Git Changes
O Ready
Add to Source Control
o TVpe here to search O ENG 2:18 AM
Top..
Test Analyze Tools Extensions Window Help Search (Ctrl+Q) UseEntityAPI Sign in
D File Edit View Gr Project Build Debug
| Live Share
Debug Any CPU

ContactsController,cs ContactsAPIDbContext.csContacts,cs Solution Explorer


UpdateContacts.cs AddConta ctRequest.cs
UseEntityAPI UseEntityAPI.Data.ContactsSAPIDbContext Ll ContactsAPIDbContext(Db ContextOptions options +
using System. Ling: Search Solution Explorer (Ctrl+:)
using System.Threading. Tasks;
6 using UseEntityAPI.Models;
Solution 'UseEntityAPl' (1 of 1project)
7
UseEntityAPI
8 Enamespace UseEntityAPI.Data G> Connected Services
9 H Dependencies
4references D Properties
1 E public class ContactsAPIDbContext : DbContext Controllers
11 C* ContactsController.cs
Oreferences
12 public ContactsSAPIDbContext (DbContextoptions options): base(options) C# WeatherForecastController.cs
13 Data
14 C# Contact_APIDbContext.cs
15 Models
B references
c# AddContactRequest.cs
16 public DbSet<Contacts> contacts { get; set; } C* Contacts.cs
17
18
c# UpdateContacts.cs
10 J appsettingsjson
C# Program.cs
C* Startup.cs
C# WeatherForecast.cs

Ch: 6 SPC GRLE Solution Explorer Git Changes


100 % No issues found
Add toSource Control A
J Ready ENG 2:18 AM
O l Top... IN 7/8/2023
OType here to search

acer AUTO MENU


Build Debug Test Analyze Tools Extensions Window Help Search (Ctrl+0) UseEntityAPI Sign in
DO File Edit View Git Project
|A Live Share
e-l - - -Debug Any CPU IIS Express

UpdateContacts.cs AddContactRequest.cs ContactsController.cs Xx ContactsAPIDbContext.cs Contacts,cs Solution Explorer


UseEntityAPI UseEntityAPI.Controllers.ContactsController UpdateContacts(Guid id, UpdateContacts updateCc -
Busing Microsoft.AspNetCore.Mvc; Search Solution Explorer (Ctr+)
2 using Microsoft.EntityFrameworkCore;
using System; l Solution 'UseEntityAPI' (1 of 1 project)
using System.Collections.Generic; al UseEntityAPI
5 using System. Ling; G Connected Services
6 using System.Threading.Tasks; Dependencies
7 using UseEntityAPI.Data; Properties
8 using UseEntityAPI.Models;
Controllers
10 Bnamespace UseEntityAPI.Controllers C# ContactController.cs
11 c* WeathetorecastController.cs
12 [ApiController] Data
13 [Route("api/[controller]")] C# ContactsAPIDbContext.cs
1 reference
Models
14 public class ContactsController : Controller
15 C# AddContactRequest.cs
C# Contacts.cs
16
private readonly ContactsAPIDbContext dbContext;
17 C* UpdateContacts.cs
O
references
5J appsettings.json
18
public ContactsController(ContactsAPIDbContext dbcontext) c* Program.cs
19
20 this.dbContext =dbContext; C* Startup.cs
21 } C* WeatherForecast.cs
[HttpGet]
23
Oreferences
24
public async Task<IActionResult> GetContacts()
29 [HttpPost]
O references
31
47
public async Task<IActionResult> AddContacts (AddContactReguest addcontact)l
[HttpPut]
48
40
[Route("{id: guidy")]
O references
50 public async Task<IActionResult> UpdateContacts([FromRoute] Guid id, UpdateContacts updateContact
File Edit View Git Project Build Debug Test Analyze Tools Extensions Window Help Search (CtrlQ) UseEntityAPI Sign in A.
-0- - - Debug Any CPU IS Express 1A Live Share

gUpdateConta cts.cs AddContactRequest.cs ContactsController.cs X ContactsAPIDbContext. cs Contacts. C$ Solution Explorer Notifications


Diagnostic
lools
8UseEntityAPI -UseEntityAPl.Controllers.ContactsController UpdateContacts(Guid id, UpdateContacts updateCc +
Oreterences
18 public ContactsController (ContactsAPIDbContext dbContext) Search Solution Explorer (Ctrl+)
19
2 this. dbContext = dbContext; a Solution 'UseEntityAPl' (1 of 1project)
21 l UseEntityAPI
22 [HttpGet] @ Connected Services
2 Dependencies
Oreferences D Properties
24 public async Task<IActionResult> GetContacts() Controllers
29 [HttpPost] C# ContactsController.cs
C# WeatherForecastController.cs
O references
Data
public async Task<IActionResult> AddContacts(AddContactRequest addContact)|AE
47 [HttpPut] c# ContactsAPIDbContext.cs
48
[Route (" {id: guid}")] Models
49 c# AddContactRequest.cs
Oreferences c# Contacts.cs
50 public async Task<IActionResult> UpdateContacts([FromRoute] Guid id, Updatecontacts updatecontacts) C# UpdateContacts.cs
51
52 var cont= await dbContext.contacts.FindAsync(id); 5I appsettings.json
53 C* Program.cs
54 if (cont != null) c# Startup.cs
55 c# WeatherForecast.cs
56 cont.Address = updateContacts.Address;
57 cont.Email = updateContacts.Email;
58 cont.Mobile = updateContacts.Mobile;
59 cont.Name = updateContacts.Name;
60
61 await dbContext.SaveChangesAsync();
62
63 return Ok(cont);
64
65 return NotFound();
66 }
67
68

100 9% O No issues found Ln: 62 Ch: 17 SPC CRLF Solution Explorer Git Changes
O Ready Add to Source Control
ENG 2:19 AM
Type here to search Top... IN 7/8/2023

acer AUTO MENU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy