コード例 #1
0
ファイル: LogMaintainer.cs プロジェクト: guozanhua/phmi
 public LogMaintainer(
     logs log,
     ILogRepository repository,
     ITimeService timeService,
     INpgsqlConnectionFactory connectionFactory)
 {
     _repository = repository;
     _timeService = timeService;
     _connectionFactory = connectionFactory;
     _timeToStore = log.time_to_store.HasValue ? new TimeSpan(log.time_to_store.Value) as TimeSpan? : null;
 }
コード例 #2
0
 public ILogMaintainer Create(string connectionString, logs log, ITimeService timeService)
 {
     var npgsqlConnectionFactory = new NpgsqlConnectionFactory(connectionString);
     var logRepository = new LogRepository(log.id);
     using (var connection = npgsqlConnectionFactory.Create())
     {
         logRepository.EnsureTable(connection);
     }
     return new LogMaintainer(
         log,
         logRepository,
         timeService,
         npgsqlConnectionFactory);
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the logs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTologs(logs logs)
 {
     base.AddObject("logs", logs);
 }
コード例 #4
0
 /// <summary>
 /// Create a new logs object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 /// <param name="name">Initial value of the name property.</param>
 public static logs Createlogs(global::System.Int32 id, global::System.String name)
 {
     logs logs = new logs();
     logs.id = id;
     logs.name = name;
     return logs;
 }