Class SqlServiceBase<TId, TModel>
Implements the basic service method with a repository that derives from IRepositoryBase<TId, TModel>
Inheritance
System.Object
SqlServiceBase<TId, TModel>
Implements
IRepositoryBase<TId, TModel>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Simplic.Data
Assembly: Simplic.Data.dll
Syntax
public abstract class SqlServiceBase<TId, TModel> : IRepositoryBase<TId, TModel>
Type Parameters
Name | Description |
---|---|
TId | A key which represents the primary key in the database |
TModel | A model that contains the necessary information |
Constructors
| Improve this Doc View SourceSqlServiceBase(IRepositoryBase<TId, TModel>)
Constructor for dependency injection
Declaration
public SqlServiceBase(IRepositoryBase<TId, TModel> repositoryBase)
Parameters
Type | Name | Description |
---|---|---|
IRepositoryBase<TId, TModel> | repositoryBase | A repository that handles the data acess layer |
Methods
| Improve this Doc View SourceDelete(TId)
Declaration
public virtual bool Delete(TId id)
Parameters
Type | Name | Description |
---|---|---|
TId | id |
Returns
Type | Description |
---|---|
System.Boolean |
Delete(TModel)
Declaration
public virtual bool Delete(TModel obj)
Parameters
Type | Name | Description |
---|---|---|
TModel | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Get(TId)
Declaration
public virtual TModel Get(TId id)
Parameters
Type | Name | Description |
---|---|---|
TId | id |
Returns
Type | Description |
---|---|
TModel |
GetAll()
Declaration
public virtual IEnumerable<TModel> GetAll()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TModel> |
Save(TModel)
Declaration
public virtual bool Save(TModel obj)
Parameters
Type | Name | Description |
---|---|---|
TModel | obj |
Returns
Type | Description |
---|---|
System.Boolean |