Skip to content

Instantly share code, notes, and snippets.

@Injac
Created October 7, 2014 16:50
Show Gist options
  • Save Injac/a34f433ba0eb7043b064 to your computer and use it in GitHub Desktop.
Save Injac/a34f433ba0eb7043b064 to your computer and use it in GitHub Desktop.
Sample IDataService
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
/// <summary>
/// Interface that specifies
/// the CRUD operations to
/// replicate the online data
/// locally.
/// </summary>
public interface IReplicaService<U> where U:class {
/// <summary>
/// Gets or sets the database context.
/// </summary>
/// <value>
/// The database context.
/// </value>
U DatabaseContext {
get;
set;
}
/// <summary>
/// Initializes the replica database.
/// </summary>
/// <param name="dbPath">The database path.</param>
/// <returns></returns>
Task InitReplicaDb(string dbPath);
/// <summary>
/// Adds the replica entry.
/// </summary>
/// <param name="query">The query.</param>
/// <returns></returns>
Task AddReplicaEntry<T>(T entity);
/// <summary>
/// Deletes the replica entry.
/// </summary>
/// <param name="query">The query.</param>
/// <returns></returns>
Task DeleteReplicaEntry<T>(T entity);
/// <summary>
/// Updates the replica entry.
/// </summary>
/// <param name="query">The query.</param>
/// <returns></returns>
Task UpdateReplicaEntry<T>(T entity);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment