Commit 148486ff by AlexNasyr

cosmetic

parent 70d7e38d
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using SocialMinistryDataExchange.Model;
using System.Collections.Generic;
using System.Text.Json;
......@@ -31,13 +29,11 @@ namespace SocialMinistryDataExchange.Controllers {
[HttpGet]
[Route("[controller]/getpersonFixDoc")]
public async Task<List<SMResponce>> GetPersonFixDoc() {
var request = JsonSerializer.Serialize(new SMRequest() { rowguid_eais = "223322", document_seria = "1234", document_number = "123456" });
var result = await _context.GetPersonByDoc(request);
var result = await _context.GetPersonByDoc(JsonSerializer.Serialize(new SMRequest() { rowguid_eais = "223322", document_seria = "1234", document_number = "123456" }));
return result;
}
[HttpPost]
[Route("[controller]/getpersonByDoc/{Rowguid}/{Seria}/{Number}")]
//[Route("[controller]/getpersonByDoc/{q}")]
public async Task<List<SMResponce>> GetPersonFixDoc(string Rowguid, string Seria, string Number) {
var result = await _context.GetPersonByDoc(JsonSerializer.Serialize(new SMRequest() { rowguid_eais = Rowguid, document_seria = Seria, document_number = Number }));
return result;
......
using System;
using Microsoft.EntityFrameworkCore;
using System;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
#nullable disable
namespace SocialMinistryDataExchange.Model.DB.Center
{
namespace SocialMinistryDataExchange.Model.DB.Center {
public partial class Контингент_center_Context : DbContext, ISMContext {
public Task<List<SMResponce>> GetPersonByDoc(string document) {
......
using Microsoft.EntityFrameworkCore;
using SocialMinistryDataExchange.Model.DB.Center;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace SocialMinistryDataExchange.Model {
public interface ISMContext {
//DbSet<Личность> Persons { get; set; }
//DbSet<ЛичностьПодразделения> PersonDepartments { get; set; }
//DbSet<Территория> Locations { get; set; }
//DbSet<ОбразовательнаяОрганизация> Organizations { get; set; }
//DbSet<ВидУчредителя> OrganizationFounders { get; set; }
//DbSet<ДокументЛичности> PersonDocuments { get; set; }
//DbSet<ВидУдостоверяющегоДокумента> DocumentType { get; set; }
//DbSet<ОбразовательнаяПрограммаОрганизации> EducationPrograms { get; set; }
//DbSet<ТипОбразовательнойПрограммы> EducationProgramType { get; set; }
//DbSet<ФормаОбучения> EducationForm { get; set; }
Task<List<SMResponce>> GetPersonByID(string ID);
Task<List<SMResponce>> GetPersonByDoc(string Document);
}
......
namespace SocialMinistryDataExchange.Model {
public class SMRequest {
public string rowguid_eais { get; set; }
public string document_seria { get; set; }
public string document_number { get; set; }
}
}
using System;
namespace SocialMinistryDataExchange.Model {
public class SMRequest {
public string rowguid_eais { get; set; }
public string document_seria { get; set; }
public string document_number{ get; set; }
}
public class SMResponce {
public string rowguid_eais { get; set; }
......
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SocialMinistryDataExchange {
public class Program {
......
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
using SocialMinistryDataExchange.Model;
using SocialMinistryDataExchange.Model.DB.Center;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SocialMinistryDataExchange {
public class Startup {
......@@ -35,9 +28,7 @@ namespace SocialMinistryDataExchange {
services.AddSwaggerGen(c => {
c.SwaggerDoc("v1", new OpenApiInfo { Title = "SocialMinistryDataExchange", Version = "v1" });
});
services.AddDbContext<SMContext>(options =>
options.UseSqlServer(ConnectionString));
//services.AddTransient<ISMContext, SMContext>();
services.AddDbContext<Êîíòèíãåíò_center_Context>(options => options.UseSqlServer(ConnectionString));
services.AddTransient<ISMContext, Êîíòèíãåíò_center_Context>();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment