public static ImportBatch ToEntity(this ImportBatchesViewModelItem model)
        {
            var item = new ImportBatch
            {
                ImportBatchId   = model.ImportBatchId,
                ImportBatchName = model.ImportBatchName,
                Current         = model.Current
            };

            return(item);
        }
        public static ImportBatchesViewModelItem Populate(this ImportBatchesViewModelItem model, ProviderPortalEntities db, int id)
        {
            var item = db.ImportBatches.FirstOrDefault(x => x.ImportBatchId == id);

            if (item == null)
            {
                return(null);
            }
            model = new ImportBatchesViewModelItem
            {
                ImportBatchId   = item.ImportBatchId,
                ImportBatchName = item.ImportBatchName,
                Current         = item.Current
            };
            return(model);
        }