/// <summary> /// Maps a registration to a context. /// </summary> /// <param name="context">The context to map to.</param> /// <param name="entity">The entity to map from.</param> private static void MapToWriter(DatabaseContext context, NotificationRegistration entity) { context.AddParameterWithValue("external_id", entity.ExternalId); context.AddParameterWithValue("handle", entity.Handle); context.AddParameterWithValue("id", entity.Id); context.AddParameterWithValue("push_notification_platform", entity.PushNotificationPlatform); }
/// <summary> /// Maps a reaction to a database context. /// </summary> /// <param name="context">The context to map to.</param> /// <param name="entity">The entity to map from.</param> private static void MapToWriter(DatabaseContext context, Reaction entity) { context.AddParameterWithValue("is_private", entity.IsPrivate); context.AddParameterWithValue("length", entity.Length); context.AddParameterWithValue("reaction_status", entity.ReactionStatus); context.AddParameterWithValue("target_vlog_id", entity.TargetVlogId); context.AddParameterWithValue("user_id", entity.UserId); }
/// <summary> /// Maps a swabbr user entity onto a writer. /// </summary> /// <param name="context">The context to add parameters to.</param> /// <param name="user">The user object.</param> private static void MapToWriter(DatabaseContext context, User user) { context.AddParameterWithValue("birth_date", user.BirthDate); context.AddParameterWithValue("country", user.Country); context.AddParameterWithValue("daily_vlog_request_limit", (int)user.DailyVlogRequestLimit); context.AddParameterWithValue("first_name", user.FirstName); context.AddParameterWithValue("follow_mode", user.FollowMode); context.AddParameterWithValue("gender", user.Gender); context.AddParameterWithValue("has_profile_image", user.HasProfileImage); context.AddParameterWithValue("is_private", user.IsPrivate); context.AddParameterWithValue("last_name", user.LastName); context.AddParameterWithValue("latitude", user.Latitude); context.AddParameterWithValue("longitude", user.Longitude); context.AddParameterWithValue("nickname", user.Nickname); context.AddParameterWithValue("timezone", TimeZoneInfoHelper.MapTimeZoneToStringOrNull(user.TimeZone)); }
/// <summary> /// Map a follow request to the context. /// </summary> /// <param name="context">The context to map to.</param> /// <param name="entity">The entity to map from.</param> private static void MapToWriter(DatabaseContext context, FollowRequest entity) { context.AddParameterWithValue("receiver_id", entity.Id.ReceiverId); context.AddParameterWithValue("requester_id", entity.Id.RequesterId); }