C# Class SIP_Agent.Model.Crud

Abstract class for all CRUD models
Afficher le fichier Open project: anroots/SIP-Agent

Protected Properties

Свойство Type Description
CurrentConnection DatabaseDataContext

Private Properties

Свойство Type Description

Méthodes publiques

Méthode Description
Crud ( ) : System

Default constructor - create a new DatabaseDataContext

FindAll ( int Limit ) : IQueryable

Find all non-deleted rows

Load ( int Id ) : bool

Load the model with the specified ID

Loaded ( ) : bool

Check if the model is loaded

New ( ) : int

Create a new row

Save ( ) : int

Save the currently loaded model

Unload ( ) : void

Unload the model

Méthodes protégées

Méthode Description
ResetConnection ( ) : void

Reset the DB connection

Method Details

Crud() public méthode

Default constructor - create a new DatabaseDataContext
public Crud ( ) : System
Résultat System

FindAll() public méthode

Find all non-deleted rows
public FindAll ( int Limit ) : IQueryable
Limit int Max number of rows to return
Résultat IQueryable

Load() public méthode

Load the model with the specified ID
public Load ( int Id ) : bool
Id int The ID of the row in the database
Résultat bool

Loaded() public méthode

Check if the model is loaded
public Loaded ( ) : bool
Résultat bool

New() public méthode

Create a new row
public New ( ) : int
Résultat int

ResetConnection() protected méthode

Reset the DB connection
protected ResetConnection ( ) : void
Résultat void

Save() public méthode

Save the currently loaded model
public Save ( ) : int
Résultat int

Unload() public méthode

Unload the model
public Unload ( ) : void
Résultat void

Property Details

CurrentConnection protected_oe property

Stores the current database connection. In order for SubmitChanges to work the connection must stay open. The connection can be released by the Unload method.
protected DatabaseDataContext CurrentConnection
Résultat DatabaseDataContext