ReSharper always asks to change System.Action to System.Action<T>
Tag : chash , By : CookingCoder
Date : March 29 2020, 07:55 AM
this will help Seems to me that you need to update ReSharper to the latest version, which is version 5.1. If you have items that are not loaded by ReSharper (i.e., check your excluded items list), then it will mark them as unknown, even if your code is legal and references the items. You may try Clear Cache, or reset default settings. private Action ExtractFile()
{
return () => MessageBox.Show("Test");
}
|
Argument 'System.Action' is not assignable to parameter type 'System.Threading.SendOrPostCallback'
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further From MSDN. public virtual void Send(SendOrPostCallback d, Object state)
public delegate void SendOrPostCallback(Object state)
syncContext.Send(new Action(o => { ...
|
Cannot convert type 'System.Action<int>' to 'System.Action<object>'
Tag : chash , By : liquidx
Date : March 29 2020, 07:55 AM
like below fixes the issue I am wondering how I achieve something like this? , Well, you could wrap the first action: Action<object> test2 = (object o) => test((int)o);
|
Cannot convert from 'void' to System.Threading.Tasks.Task<System.Action>
Tag : chash , By : UnKnownUser
Date : March 29 2020, 07:55 AM
like below fixes the issue I have write generic method using hangfire .Net. Basically i want to achieve that i have generate one method and want to call it multiple times when ever it is required. My helper method is below: , I have done it by changing my methods like public static void ScheduleBackGroundJob(Expression<Action> _refmethod, DateTime _dateTime)
{
try
{
var _currentDate = DateTime.Now;
TimeSpan _timeSpan = _dateTime - _currentDate;
BackgroundJob.Schedule(_refmethod, _timeSpan);
}
catch (Exception ex)
{
throw ex;
}
}
HangfireHelper.ScheduleBackGroundJob(() => _service.UpdateAuctionStatus(result), result.PlannedCloseDate);
public async Task UpdateAuctionStatus(AuctionReturnModel model)
{
try
{
var _auction = await (from d in _db.Auction_Detail where d.Id == model.AuctionDetailId select d).FirstOrDefaultAsync();
_auction.isEnded = true;
_db.Auction_Detail.Add(_auction);
_db.SaveChanges();
var _auctionHistory = new AuctionHistory { AuctionDetail_Id = model.AuctionDetailId, EndedDate = DateTime.Now, EndedMethod = "Automatic" };
_db.AuctionHistory.Add(_auctionHistory);
_db.SaveChanges();
Task.WaitAll();
}
catch (Exception ex)
{
throw ex;
}
}
|
Who should subscribe to NGXS async action - the dispatch action caller or the @Action handler?
Date : March 29 2020, 07:55 AM
this one helps. I think it is somewhat a matter of style, but I'd say (from my usage of NGXS) this is most typical: On dispatch do this, and only subscribe here if there's some post-action you want to do.
|