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
namespace DependencyInjection.Domain | |
{ | |
public class Student | |
{ | |
public Guid Id { get; set; } | |
public string Name { get; set; } | |
} | |
} |
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
namespace DependencyInjection.Repository | |
{ | |
public interface IStudentRepository | |
{ | |
IEnumerable GetAll(); | |
} | |
public class StudentRepository : IStudentRepository | |
{ | |
public IEnumerable GetAll() | |
{ |
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
namespace DependencyInjection.Services | |
{ | |
public interface IStudentService | |
{ | |
IEnumerable GetAllStudents(); | |
} | |
public class StudentService:IStudentService | |
{ | |
private readonly IStudentRepository _studentRepository; | |
public StudentService(IStudentRepository studentRepository) |
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
namespace DependencyInjection | |
{ | |
public class Startup | |
{ | |
public Startup(IConfiguration configuration) | |
{ | |
Configuration = configuration; | |
} | |
public IConfiguration Configuration { get; } | |
public void ConfigureServices(IServiceCollection services) |
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
namespace DependencyInjection.Controllers | |
{ | |
[Route("api/[controller]")] | |
[ApiController] | |
public class StudentController : ControllerBase | |
{ | |
private readonly IStudentService _studentService; | |
public StudentController(IStudentService cityService) | |
{ | |
this._studentService = cityService; |
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
"employees":[ | |
{"firstName":"John", "lastName":"Doe"}, | |
{"firstName":"Anna", "lastName":"Smith"}, | |
{"firstName":"Peter", "lastName":"Jones"} | |
] |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace DependencyInjection.Domain | |
{ | |
public class Member | |
{ | |
public string Name { get; set; } |
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
using System.Collections.Generic; | |
using System.Linq; | |
using DependencyInjection.Domain; | |
using Microsoft.AspNetCore.Mvc; | |
using Newtonsoft.Json; | |
namespace DependencyInjection.Controllers | |
{ | |
[Route("api/[controller]")] | |
[ApiController] |
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
using System.Collections.Generic; | |
using System.Linq; | |
using DependencyInjection.Domain; | |
using Microsoft.AspNetCore.Mvc; | |
using Newtonsoft.Json; | |
namespace DependencyInjection.Controllers | |
{ | |
[Route("api/[controller]")] | |
[ApiController] |
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
public JsonResult AxDepoHareket(int[] TABLEID, int BOLMEID) | |
{ | |
var trans = db.Database.BeginTransaction(); | |
try | |
{ | |
foreach (int item in TABLEID) | |
{ | |
var guncelle = db.TBLSTOKHAREKET.Find(item); | |
guncelle.BOLMEID = BOLMEID; | |
db.SaveChanges(); |
OlderNewer