Skip to content

Instantly share code, notes, and snippets.

View ismailkasan's full-sized avatar

İsmail KAŞAN ismailkasan

View GitHub Profile
namespace DependencyInjection.Domain
{
public class Student
{
public Guid Id { get; set; }
public string Name { get; set; }
}
}
namespace DependencyInjection.Repository
{
public interface IStudentRepository
{
IEnumerable GetAll();
}
public class StudentRepository : IStudentRepository
{
public IEnumerable GetAll()
{
namespace DependencyInjection.Services
{
public interface IStudentService
{
IEnumerable GetAllStudents();
}
public class StudentService:IStudentService
{
private readonly IStudentRepository _studentRepository;
public StudentService(IStudentRepository studentRepository)
namespace DependencyInjection
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
namespace DependencyInjection.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class StudentController : ControllerBase
{
private readonly IStudentService _studentService;
public StudentController(IStudentService cityService)
{
this._studentService = cityService;
"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace DependencyInjection.Domain
{
public class Member
{
public string Name { get; set; }
using System.Collections.Generic;
using System.Linq;
using DependencyInjection.Domain;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
namespace DependencyInjection.Controllers
{
[Route("api/[controller]")]
[ApiController]
using System.Collections.Generic;
using System.Linq;
using DependencyInjection.Domain;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
namespace DependencyInjection.Controllers
{
[Route("api/[controller]")]
[ApiController]
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();