Exemple #1
0
        /// <summary>
        ///     This method need for reading json and convert to c# object
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="typeToConvert"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public override int Read(ref Utf8JsonReader reader,
                                 Type typeToConvert,
                                 JsonSerializerOptions options)
        {
            var directionName = reader.GetString();

            using var context = new DIMSCoreContext();
            var direction = context.Directions.FirstOrDefault(x => x.Name == directionName);

            return(direction?.DirectionId ?? 0);
        }
Exemple #2
0
        /// <summary>
        ///     This method need for reading c# object and convert to json
        /// </summary>
        /// <param name="writer"></param>
        /// <param name="value"></param>
        /// <param name="options"></param>
        public override void Write(Utf8JsonWriter writer,
                                   int value,
                                   JsonSerializerOptions options)
        {
            var directionId = value;

            using var context = new DIMSCoreContext();
            var direction = context.Directions.FirstOrDefault(x => x.DirectionId == directionId);

            if (direction != null)
            {
                writer.WriteStringValue(direction.Name);
            }
            else
            {
                writer.WriteNullValue();
            }
        }
Exemple #3
0
        protected BaseRepositoryFixture()
        {
            Context = ContextCreator.CreateContext();

            InitDatabase();
        }
Exemple #4
0
 public TaskRepository(DIMSCoreContext context) : base(context)
 {
 }
 public VTaskRepository(DIMSCoreContext context)
 {
     _context = context;
 }
 public UnitOfWork(DIMSCoreContext context)
 {
     _context = context;
 }
 public VUserTrackRepository(DIMSCoreContext context) : base(context)
 {
 }
 public UserProfileRepository(DIMSCoreContext context) : base(context)
 {
 }
Exemple #9
0
 public DirectionRepository(DIMSCoreContext context) : base(context)
 {
 }
 protected ReadOnlyRepository(DIMSCoreContext context)
 {
     _context = context;
 }
Exemple #11
0
 public VUserProgressRepository(DIMSCoreContext context) : base(context)
 {
 }
Exemple #12
0
 public VUserProfileRepository(DIMSCoreContext context)
 {
     _context = context;
 }