Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_createOnAfterAsync var removed from code gen DataSvc when DataSvcCustom="true" on operation #15

Closed
Simke11 opened this issue Jan 16, 2020 · 0 comments

Comments

@Simke11
Copy link
Contributor

Simke11 commented Jan 16, 2020

When DataSvcCustom="true" is set on an operation,

private static readonly Func<Entity, Task> _createOnAfterAsync; 

is removed from generated DataSvc class, but is still used in the generated method, e.g.

public static Task CreateAsync(Entity value)
{
	return DataSvcInvoker.Default.InvokeAsync(typeof(EntityDataSvc), async () => 
	{
		await CreateOnImplementationAsync(value);
		if (_createOnAfterAsync != null) await _createOnAfterAsync(value);
	});
}

This results in _createOnAfterAsync having to be declared in custom partial DataSvc class.

_createOnAfterAsync declaration should either stay in code gen'd DataSvc file, or remove

if (_createOnAfterAsync != null) await _createOnAfterAsync(value);

from code gen'd method and let it be added in custom DataSvc method implementation if needed.

Operation definition for the above scenario:

<Operation Name="Create" OperationType="Custom" AutoImplement="None" WebApiMethod="HttpPost" ValueType="Reservation" WebApiStatus="Accepted" DataSvcCustom="true">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant