-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
100 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
37 changes: 24 additions & 13 deletions
37
Titan.Blog.WebAPP/Titan.Blog.AppService/DomainService/AuthorDomainSvc.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,40 @@ | ||
using Microsoft.AspNetCore.Hosting; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Titan.AppService.ModelService; | ||
using Microsoft.EntityFrameworkCore; | ||
using Titan.Blog.AppService.ModelService; | ||
using Titan.Model.DataModel; | ||
using Titan.RepositoryCode; | ||
|
||
namespace Titan.Blog.AppService.DomainService | ||
{ | ||
public class AuthorDomainSvc | ||
{ | ||
//private readonly IHostingEnvironment _hostingEnvironment; | ||
//public AuthorDomainSvc(IHostingEnvironment hostingEnvironment) | ||
//{ | ||
// _hostingEnvironment = hostingEnvironment; | ||
//} | ||
//private readonly AuthorSvc _authorSvc; | ||
//public AuthorDomainSvc(AuthorSvc authorSvc) | ||
//{ | ||
// _authorSvc = authorSvc; | ||
//} | ||
private readonly AuthorSvc _authorSvc; | ||
private ModelRespositoryFactory<Author, Guid> _modelSvc; | ||
public AuthorDomainSvc(AuthorSvc authorSvc, ModelRespositoryFactory<Author, Guid> modelSvc) | ||
{ | ||
_authorSvc = authorSvc; | ||
_modelSvc = modelSvc; | ||
} | ||
|
||
public List<Author> GetList() | ||
{ | ||
//return _authorSvc.FindModelByValue(x => true); | ||
return new List<Author>(); | ||
return _authorSvc.FindModelByValue(x => true); | ||
//return new List<Author>(); | ||
} | ||
|
||
public List<Author> SqlTest() | ||
{ | ||
return _modelSvc.context.Set<Author>().FromSql("select * from Author").ToList(); | ||
|
||
} | ||
|
||
public int CommandSql() | ||
{ | ||
return _modelSvc.context.Database.ExecuteSqlCommand("INSERT INTO [TestDB].[dbo].[Author] ([Id], [AuthorName], [PKId]) VALUES ('1', '管理员', newid());"); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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