Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Marat Pavlov
/
AlexAdapter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
148486ff
authored
Mar 17, 2022
by
AlexNasyr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cosmetic
parent
70d7e38d
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
14 additions
and
46 deletions
SocialMinistryDataExchange/Controllers/apiController.cs
SocialMinistryDataExchange/Model/DB/Center/Контингент_center_Context.cs
SocialMinistryDataExchange/Model/ISMContext.cs
SocialMinistryDataExchange/Model/SMContext.cs
SocialMinistryDataExchange/Model/SMRequest.cs
SocialMinistryDataExchange/Model/SMResponce.cs
SocialMinistryDataExchange/Program.cs
SocialMinistryDataExchange/Startup.cs
SocialMinistryDataExchange/Controllers/apiController.cs
View file @
148486ff
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
;
...
...
SocialMinistryDataExchange/Model/DB/Center/Контингент_center_Context.cs
View file @
148486ff
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
)
{
...
...
SocialMinistryDataExchange/Model/ISMContext.cs
View file @
148486ff
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
);
}
...
...
SocialMinistryDataExchange/Model/SMContext.cs
deleted
100644 → 0
View file @
70d7e38d
This diff is collapsed.
Click to expand it.
SocialMinistryDataExchange/Model/SMRequest.cs
0 → 100644
View file @
148486ff
namespace
SocialMinistryDataExchange.Model
{
public
class
SMRequest
{
public
string
rowguid_eais
{
get
;
set
;
}
public
string
document_seria
{
get
;
set
;
}
public
string
document_number
{
get
;
set
;
}
}
}
SocialMinistryDataExchange/Model/SMResponce.cs
View file @
148486ff
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
;
}
...
...
SocialMinistryDataExchange/Program.cs
View file @
148486ff
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
{
...
...
SocialMinistryDataExchange/Startup.cs
View file @
148486ff
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
>();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment