示例#1
0
    public IBaseTextModel EndModelSolver(string line)
    {
        string[] splitedStr = CutOutStrSet(line);
        EndModel endModel   = new EndModel(NotNullStr(splitedStr[0]), NotNullStr(splitedStr[1]));

        return(endModel);
    }
示例#2
0
        public async Task <int> EndCourse(EndModel end)
        {
            int res = 0;

            try
            {
                var off = await _db.JobOffer.Where(x => x.Id == end.OfferId).FirstOrDefaultAsync();

                if (off != null)
                {
                    var offer = new Model.JobOffer();
                    offer        = off;
                    offer.Status = end.StatusId;
                    _db.Entry(off).CurrentValues.SetValues(offer);
                    _db.JobOffer.Update(off);
                    await _db.SaveChangesAsync();

                    return(1);
                }

                return(0);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message);
            }

            return(res);
        }
示例#3
0
        static void Main(string[] args)
        {
            var beginModel = new BeginModel()
            {
                Name = "naroJay", testValue = 10
            };

            Mapper.Initialize(test =>
            {
                test.CreateMap <BeginModel, EndModel>();
            });
            EndModel end = Mapper.Map <EndModel>(beginModel);

            Console.WriteLine(end.testValue);
        }
示例#4
0
        public async Task <IActionResult> EndCourse([FromBody] EndModel offer)
        {
            var result = await _job.EndCourse(offer);

            return(Ok(result));
        }